import uuid

def generate_id():
    """Generate a unique 8-digit ID to identify the project"""
    return str(uuid.uuid4())[:8]

def create_Pokémon(Pokémon, name, Pokémon_type, level):
    """Add new Pokémon to the collection (maximum 4)"""
    if len(Pokémon) >= 4:
        print("Error❌: Maximum 4 Pokémon!")
        return Pokémon
    if not name or not Pokémon_type:
        print("Error❌: Name and type cannot be empty!") 
        return Pokémon
    if not isinstance(level, int) or level < 1:
        print("Error❌: The level must be a positive integer!")
        return Pokémon
    
    new_Pokémon = {
        "id": generate_id(),
        "name": name,
        "type": Pokémon_type,
        "level": level
        }
    Pokémon.append(new_Pokémon)
    print("Add new items sucessfully!")
    return Pokémon

if __name__ == "__main__":
    print("Testing create_Pokémon...")
    test_Pokémon = []
    test_Pokémon = create_Pokémon(test_Pokémon, "Warrior", "Fighter", 10)
    test_Pokémon = create_Pokémon(test_Pokémon, "Mage", "Wizard", 8)
    print(f"Total Pokémon: {len(test_Pokémon)}")
    print(test_Pokémon)